import { ToastController } from 'ionic-angular';
import { ViewChild, Renderer2 } from '@angular/core';
import { MySeriveProvider } from './../../../providers/my-serive/my-serive';
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { BaseUI } from '../../../common/baseUI';

/**
 * Generated class for the AllSorcePage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-all-sorce',
  templateUrl: 'all-sorce.html'
})
export class AllSorcePage extends BaseUI {
  user;
  showlist;
  evaluatingcode;
  info;
  username;
  allvalue = 0;

  constructor(
    public navCtrl: NavController,
    public navParams: NavParams,
    public mySerive: MySeriveProvider,
    public toastCtrl: ToastController,
    public render: Renderer2
  ) {
    super();
    this.user = this.navParams.get('user');
    this.info = this.navParams.get('info');
    this.info = JSON.parse(this.info['evaluatingallthescores']);
    this.sorce();
  }

  ionViewDidLoad() { }

  ionViewWillEnter() { }

  sorce() {
    for (let i = 0; i < this.info.length; i++) {
      this.allvalue += this.info[i].value;
    }
  }
}
